﻿<include file="Public:mainHeader" />
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" class="mart15">
  <tr>
    <td width="4"><img src="__IMG_ADMIN_PATH__/gk1.png" width="4" height="39" /></td>
    <td background="__IMG_ADMIN_PATH__/gk2.png"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="23" class="xtgk2"><img src="__IMG_ADMIN_PATH__/gk_1.png" width="16" height="16" /></td>
        <td class="xtgk1">分类列表</td>
      </tr>
    </table></td>
    <td width="5"><img src="__IMG_ADMIN_PATH__/gk3.png" width="5" height="39" /></td>
  </tr>
</table>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#dca581">
  <tr>
    <td bgcolor="#FFFFFF">
	<table width="95%" id="mytable" border="0" align="center" cellpadding="10" cellspacing="1" bgcolor="#efddd2" class="mart15 marb15 color333">
      <tr>
        <td align="center" bgcolor="#f5ede6"><h1>序号</h1></td>
        <td align="center" bgcolor="#f5ede6"><h1>分类名称</h1></td>
        <td align="center" bgcolor="#f5ede6"><h1>状态</h1></td>
        <td align="center" bgcolor="#f5ede6"><h1>数据量</h1></td>
        <td align="center" bgcolor="#f5ede6"><h1>操作</h1></td>
      </tr>
        <foreach name="arr" item="v">
      <tr>
        <td align="center">{$v.id}</td>
        <td align="center">{$v.dname}</td>
        <td align="center"><img class="typeStatus{$v.id} typeStatus parentid_1_{$v.parentid}" id="typeStatus_1_{$v.id}" value="1" style="vertical-align:middle;cursor:pointer;" onclick="javascript:type_fetch_ajax('typeStatus_1_','{$v.id}','{$v.parentid}');" <if condition="$v['show'] eq 1"> src="__IMG_ADMIN_PATH__/yes.gif" status="1" <else /> src="__IMG_ADMIN_PATH__/no.gif" status="0" </if>>显示
            <img class="typeStatus{$v.id} typeStatus parentid_2_{$v.parentid}" id="typeStatus_2_{$v.id}" value="2"style="vertical-align:middle;cursor:pointer;" onclick="javascript:type_fetch_ajax('typeStatus_2_','{$v.id}','{$v.parentid}');" <if condition="$v['show'] eq 2"> src="__IMG_ADMIN_PATH__/yes.gif" status="1" <else /> src="__IMG_ADMIN_PATH__/no.gif" status="0" </if>>隐藏</td>
        <td align="center">{$v.m}个</td>
        <td align="center"><a href="{:U(GROUP_NAME.'/Menu/editType',array('id'=>$v['id']))}">修改</a>&nbsp;&nbsp;<a href="{:U(GROUP_NAME.'/Menu/delType',array('id'=>$v['id']))}">删除</a></td>
      </tr>
        </foreach>
    </table>
        <div style=" color: #FF6500; font-size: 14px; margin: 3px 3px 15px; padding: 3px; text-align: center;">
            {$page}
        </div>
    </td>
        </tr>
      </table></td>
  </tr>
</table>
<script>
//列表中修改单一数据的各种状态 added by Tony
function type_fetch_ajax(par,id,parentid){
	var imgUrl = '/Public/Admin/images/';
	var statusVal = $('#'+par+id).attr ('status');
	var value = $('#'+par+id).attr ('value');
	if(statusVal == 1){
	var imgName = 'no.gif';
	var status = 0;
	}else{
	var imgName = 'yes.gif';
	var status = 1;
	}
	if(statusVal!=1){
		var tagStr = '你确定要改变分类的显示的状态吗？';
		if(parentid == 0){
			tagStr = '该分类下面包含的子类会同时修改，你确定改变分类的显示的状态吗？';
		}
		if(confirm(tagStr)){
			$.post('/index.php?g=Admin&m=Menu&a=modifTypeStatus',{'id':id,'value':value},function(re){
				if(re == 1){
					if(parentid == 0){
						$('.typeStatus').attr('status',0).attr('src',imgUrl+'no.gif');
						$('.parentid_'+value+'_'+id).attr('status',status).attr('src',imgUrl+imgName);
					}else{
						$('.typeStatus'+id).attr('status',0).attr('src',imgUrl+'no.gif');
					}
					$('#'+par+id).attr ('status',status);
					$('#'+par+id).attr ('src',imgUrl+imgName);
				}
			});
		}
	}
} 
</script>
<include file="Public:mainFooter" />